<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

	<a4j:outputPanel id="msgContainer" ajaxRendered="true">
		<h:messages globalOnly="false" errorClass="msgError" styleClass="message" infoClass="msgInfo" />
	</a4j:outputPanel>
	<a4j:form id="RaceEditForm" ajaxSingle="true">
			
		<rich:panel styleClass="form" style="width: 400px;">
			
			<div class="form_table">
				<div class="form_row">
					<div class="fields">
						<s:label for="RaceEditCode">Codigo:</s:label>
						<h:inputText value="#{editRace.editRace.cod}"
								id="RaceEditCode" 
								size="5">
								<rich:ajaxValidator 
	                    			event="onblur" 
	                    			onsubmit="validateStringField(
	                    				fieldObject = this, 
	                    				fieldMsgId = 'RaceEditCodeMsg', 
	                    				required = 'true', 
	                    				requiredMsg = 'Favor ingrese el Codigo', 
	                    				chekForLength = 'true', 
	                    				min = 1, 
	                    				max = 5,
	                    				errorClass = 'msgErrorFloat')">
           						</rich:ajaxValidator>	
						</h:inputText>	
						<div id="RaceEditCodeMsg" class="inactiveMsg"></div>
					</div>
				</div>
				<div class="form_row">
					<div class="fields">
						<s:label for="RaceEditDescrip">Descripcion:</s:label>
						<h:inputText 
								value="#{editRace.editRace.descrip}" 
								label="Descripcion"
								id="RaceEditDescrip">
								<rich:ajaxValidator 
	                    			event="onblur" 
	                    			onsubmit="validateStringField(
	                    				fieldObject = this, 
	                    				fieldMsgId = 'RaceEditDescripMsg', 
	                    				required = 'true', 
	                    				requiredMsg = 'Favor ingrese la Descripcion', 
	                    				chekForLength = 'true', 
	                    				min = 1, 
	                    				max = 30,
	                    				errorClass = 'msgErrorFloat')">
           						</rich:ajaxValidator>
						</h:inputText>
						<div id="RaceEditDescripMsg" class="inactiveMsg"></div>	
					</div>
				</div>
				<div class="form_row">
					<div class="fields">
						<s:label for="RaceEditStatus">Activo:</s:label>
						<h:selectBooleanCheckbox 
							value="#{editRace.editRace.status}" 
							id="RaceEditStatus"
							disabled="true">
							<a4j:support event="onblur" />
							</h:selectBooleanCheckbox>
					</div>
				</div>
			</div>

			<s:decorate template="/layout/displayButton.xhtml" styleClass="button_form">
				<a4j:commandButton value="Guardar"
					action="#{editRace.dataToEditUpd()}" 
					oncomplete="#{rich:component('EditModalPanel')}.hide()"
					reRender="RaceForm, RaceGridForm" styleClass="button"/>
				<rich:spacer width="20px" />
			</s:decorate>
			<a4j:commandLink
				id="buyCloseBtn"
				styleClass="button"
				onclick="#{rich:component('CloseModalPanel')}.show()" 
				style="position:relative; float:right; right:15px; margin-top:15px;">
				<h:graphicImage value="/img/icons/close.png"/>
			</a4j:commandLink>
				
		</rich:panel>
	</a4j:form>
	
</ui:composition>